package study.函数式接口;

import java.util.function.Predicate;

/**
 * @Author 金贵权
 * @Date 2023/6/16 10:49
 **/
public class RedApple extends Apple{
    public RedApple(){

    }

    public RedApple(Integer weight){
        super(weight);
    }

    public RedApple(String name,Integer weight,String color){
        super(name,weight,color);
    }

    public Predicate<Apple> negate() {
        return r-> !r.getColor().equals("红色");
    }

    public Predicate<Apple> and(Predicate<Apple> t){
        return t;
    }
}
